package com.heima.oopAdvanced.n03polymorphism.demo01;

public class demo {
    public static void main(String[] args) {
        // 多态调用成员的特点

        Animal a = new Dog();

        System.out.println(a.name);
        a.show();

    }
}

class Animal{
    public String name = "动物";

    public void show()
    {
        System.out.println("Animal");
    }
}

class Dog extends Animal{
    private String name = "狗";

    public void show()
    {
        System.out.println("Dog");
    }
}
